<?php

$this->title="有试吗-有事没事来试试";
?>
<?php $this->beginBlock('css');?>
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="<?=Yii::getAlias('@static')?>/wap/liketry/css/user.css">
<?php $this->endBlock();?>


	<header>
	  <!--<div class="header-left"><span class="icon icon-arrow-left"></span></div>-->
	  <h1>个人中心</h1>
	  <!--<div class="header-right"><span class="icon icon-home"></span></div>-->
	</header>
	<section class="user">
		<div class="user-line top">
			<div class="photo"><img <?=$data['imgSrc']?> /></div>
			<div class="user-mes">
				<h2><?=$data['username']?></h2>
				<p>UID：<?=$data['lkt_uid']?></p>
				<p>试豆：<?=$data['user_score']?></p>
				<p>余额：¥<?=$data['user_money']?></p>
			</div>
		</div>
		<div class="user-line my-order"><a href="<?=Yii::$app->urlManager->createUrl(['order-details/listwap']);?>">
			<h2>我的订单</h2>
			<p>查看所有订单<i class="icon-arrow-right"></i></p>
		</a></div>
		<div class="user-line task">
			<h2>任务游戏</h2>
			<div>
				<a id="daka"><i class="<?php echo $data['is_DaKa']? 'icon-daka':'icon-daka-purple';?>"></i>
					<span><?php echo $data['is_DaKa']? '已打卡':'打卡';?></span></a>
				<a href="<?=Yii::$app->urlManager->createUrl(['user-center/to-eggs-game']);?>"><i class="icon-egg"></i>
					<span>砸金蛋</span></a>
			</div>
		</div>
		<div class="user-line setting">
			<h2>账号设置</h2>
			<div>
				<a href="<?=Yii::$app->urlManager->createUrl(['member-address/list']);?>"><i class="icon-addr"></i><span>地址管理</span></a>
				<a href="<?=Yii::$app->urlManager->createUrl(['user-center/to-cell']);?>">
					<i class="<?php echo $data['is_bind']? 'icon-unbind':'icon-bind';?>"></i>
					<span><?php echo $data['is_bind']? '解绑手机':'绑定手机';?></span>
				</a>
			</div>
		</div>
	</section>

<nav>
	<div class="box">
    <a href="<?=Yii::$app->urlManager->createUrl(['index/index']);?>" class="flex1"><span></span><p>首页</p></a>
    <a href="<?=Yii::$app->urlManager->createUrl(['category/index']);?>" class="flex1"><span></span><p>分类</p></a>
    <a href="<?=Yii::$app->urlManager->createUrl(['cart/index']);?>" class="flex1"><span></span><p>购物车</p></a>
    <a href="<?=Yii::$app->urlManager->createUrl(['user-center/index']);?>" class="flex1 cur"><span></span><p>个人中心</p></a>
	</div>
</nav>

<?php $this->beginBlock('js');?>
<script src="<?=Yii::getAlias('@static')?>/wap/common/js/zepto.min.js"></script>
<script src="<?=Yii::getAlias('@static')?>/wap/common/js/fastclick.min.js"></script>
<script src="<?=Yii::getAlias('@static')?>/wap/common/js/king.wap.js"></script>
<script>
	/*点击打卡*/
	$("#daka").on("click",function(){
		if($("#daka i").hasClass("icon-daka")){
			return false;
		}
		$.doAjax({
			url: "<?=Yii::$app->urlManager->createUrl(Yii::$app->controller->id . '/clock-in')?>",		//接口地址
			type:"post",	//get还是post
			success: function(data){
				if(data.flag){
					$("#daka i").removeClass("icon-daka-purple").addClass("icon-daka");
					$("#daka span").html("已打卡");
					$.tips(data.msg,3000);
				}else{	//已打卡提示打过卡了
					$.tips(data.msg,3000);
				}

			}
		});
		_hmt.push(['_trackEvent', '打卡WAP', 'click', '打卡WAP']);
	});
</script>
<?php $this->endBlock('js');?>
